import pytest
import yaml,os,yagmail,logging


def yaml_loc():
    with open('yaml1.yaml','r',encoding='utf-8') as f:
        return  yaml.safe_load(f)

def logging_loc():
    logging.basicConfig(filename="log.txt",
                        filemode='a',
                        format='%(asctime)s - %(levelname)s : %(name)s',
                        level=logging.DEBUG)

def email(filename):
    send =yagmail.SMTP(user='1048151889@qq.com',password="bgdaesrbodjxbbfi",host='smtp.qq.com')
    send.send(to='1048151889@qq.com',subject='测试报告',contents='测试报告',attachments=filename)
@pytest.fixture(scope='function')
def log():
    headers = {
        "cookie": "JSESSIONID=D927456B2BA8E5D0716A99BA7FA06067"
    }
    yield headers
